const express = require("express");
const router = express.Router();
const Daily = require("../../../controllers/daily.controller");

/**
 * 创建日报信息
 * @route POST /api/private/daily/create
 * @group 日报管理 - Operations about user
 * @returns {object} 200 - An array of user info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
// * @param {string} username.query.required - 请输入日报名
// * @param {string} password.query.required - 请输入密码
// * @param {string} nickName - 请输入昵称
// * @param {number} verificationCode - 请输入验证码
router.post("/create", Daily.create);
/**
 * 删除日报信息
 * @route POST /api/private/daily/delete
 * @group 日报管理 - delete of daily
 * @param {number} id - 请输入日报ID
 * @param {string} authorization - 请输入token
 * @returns {object} 200 - An array of user info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
router.post("/delete", Daily.delete);
/**
 * 查询日报信息列表
 * @route POST /api/private/daily/list
 * @group 日报管理 - list of daily
 * @param {object} query - 请按固定查询规范
 * @returns {object} 200 - An array of user info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
router.post("/list", Daily.findAll);
/**
 * 更新日报信息列表
 * @route POST /api/private/daily/update
 * @group 日报管理 - list of daily
 * @returns {object} 200 - An array of user info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
// * @param {string} username.query.required - 请输入日报名
// * @param {string} password.query.required - 请输入密码
// * @param {string} nickName - 请输入昵称
// * @param {number} verificationCode - 请输入验证码
router.post("/update", Daily.update);
/**
 * 更新日报信息列表
 * @route POST /api/private/daily/update
 * @group 日报管理 - list of daily
 * @returns {object} 200 - An array of user info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
//  * @param {string} password.query.required - 请输入密码
//  * @param {string} id.query.required - 请输入密码
router.post("/reset", Daily.reset);

/**
 * 删除全部日报信息
 * @route POST /api/private/daily/deleteAll
 * @group 日报管理 - list of daily
 * @returns {object} 200 - An array of user info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
router.post("/deleteAll", Daily.deleteAll);


/**
 * 按月整理日报信息
 * @route POST /api/private/daily/month
 * @group 日报管理 - list of month
 * @returns {object} 200 - An array of user info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
router.post("/month", Daily.monthAll);

/**
 * 押款日报信息
 * @route POST /api/private/daily/moneyAll
 * @group 日报管理 - list of moneyAll
 * @returns {object} 200 - An array of user info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
router.post("/moneyAll", Daily.moneyAll);

/**
 * 销售总额
 * @route POST /api/private/daily/totalMonth
 * @group 日报管理 - list of moneyAll
 * @returns {object} 200 - An array of user info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
router.post("/totalMonth", Daily.totalMonth);

/**
 * 店内各项销售占比
 * @route POST /api/private/daily/monthProportion
 * @group 日报管理 - list of monthProportion
 * @param {number} sportPayablesTotal - 体彩合计
 * @param {number} luckyPayablesTotal - 福彩合计
 * @param {number} scratchCardPayablesTotal - 刮刮卡合计
 * @param {number} totalPayablesTotal - 汇总总计
 * @param {number} total_count - 总计
 * @param {number} sportPayablesProportion - 体彩占比
 * @param {number} luckyPayablesProportion - 福彩占比
 * @param {number} scratchCardPayablesProportion - 刮刮卡占比
 * @returns {object} 200 - An array of user info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
router.post("/monthProportion", Daily.monthProportion);
/**
 *  各店销售占比
 * @route POST /api/private/daily/eachStoreProportion
 * @group 日报管理 - list of eachStoreProportion
 * @param {number} field_percentage - 各店销售占比
 * @returns {object} 200 - An array of user info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
router.post("/eachStoreProportion", Daily.eachStoreProportion);

/**
 * 压款总额
 * @route POST /api/private/daily/press
 * @group 日报管理 - list of press
 * @param {number} field_percentage - 各店销售占比
 * @returns {object} 200 - An array of user info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
router.post("/press", Daily.press);

module.exports = router;



/**
 * 验证当前日期是否提交过
 * @route POST /api/private/daily/thisdaysend
 * @group 日报管理 - list of thisdaysend
 * @returns {object} 200 - An array of user info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
router.post("/thisdaysend", Daily.thisdaysend);


/**
 * 当前时间以前最近一天有数据的
 * @route POST /api/private/daily/lastDayData
 * @group 日报管理 - list of lastDayData
 * @returns {object} 200 - An array of user info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
router.post("/lastDayData", Daily.lastDayData);



/**
 * 刮刮卡记录
 * @route POST /api/private/daily/scrapingCardRecord
 * @group 刮刮卡记录 - list of scrapingCardRecord
 * @returns {object} 200 - An array of user info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
router.post("/scrapingCardRecord", Daily.scrapingCardRecord);

/**
 * 刮刮卡记录 （每天的合计）
 * @route POST /api/private/daily/scrapingCardRecordDay
 * @group 刮刮卡记录 - list of scrapingCardRecordDay
 * @returns {object} 200 - An array of user info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
router.post("/scrapingCardRecordDay", Daily.scrapingCardRecordDay);


/**
 * 刮刮卡记录 不同店铺合计值
 * @route POST /api/private/daily/scrapingCardRecordTotal
 * @group 刮刮卡记录 - list of scrapingCardRecordTotal
 * @returns {object} 200 - An array of user info
 * @returns {object} 605 - 请求失败
 * @returns {Error}  default - Unexpected error
 */
router.post("/scrapingCardRecordTotal", Daily.scrapingCardRecordTotal);


module.exports = router;